package betaclass.web.test;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import betaclass.service.ProductManager;

@Controller
@RequestMapping("/hello.html")
public class InventoryController {

    protected final Log logger = LogFactory.getLog(getClass());

    private ProductManager productManager;

	@RequestMapping(method = RequestMethod.GET)
	public String printWelcome(ModelMap model, HttpServletRequest request, HttpServletResponse response) {

        String now = (new java.util.Date()).toString();
        logger.info("returning hello view with " + now);

        model.addAttribute("now", now);

        return "hello";
    }


    public void setProductManager(ProductManager productManager) {
        this.productManager = productManager;
    }
  }
